package com.learning.springcloudconsumer.client;

import com.learning.springcloudconsumer.bean.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * (description)
 *
 * @author jinlong.liao on 2018/3/27
 */
@FeignClient(name = "producer-service", path = "/users", fallback = ProducerUserFallback.class)
public interface ProducerUserClient {

    @GetMapping("/hi")
    String hi(@RequestParam("str") String str);

    @GetMapping
    List<User> list(@RequestParam("ids") List<Integer> ids);

    @GetMapping("/{id}")
    User get(@PathVariable("id") Integer id);

}
